package com.atguigu.tingshu.common.annotation;

import com.atguigu.tingshu.common.constant.RedisConstant;
import io.swagger.v3.oas.annotations.media.Schema;

import java.lang.annotation.*;

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface TingShuCache {
    @Schema(description = "redis缓存key的前缀")
    String cachePrefix() default RedisConstant.CACHE_INFO_PREFIX;

    @Schema(description = "过期时间")
    long timeout() default RedisConstant.CACHE_TIMEOUT;

    @Schema(description = "过期时间")
    long nullTimeout() default RedisConstant.CACHE_TEMPORARY_TIMEOUT;

    @Schema(description = "随机因子，主要为了防止缓存雪崩问题")
    long random() default RedisConstant.CACHE_STAT_TIMEOUT;

    @Schema(description = "布隆过滤器")
    String bloomFilter() default RedisConstant.CACHE_BLOOM_FILTER;

    @Schema(description = "分布式锁的前缀")
    String lockPrefix() default RedisConstant.CACHE_LOCK_PREFIX;
}
